const { defineConfig } = require('@vue/cli-service')
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = defineConfig({
  configureWebpack: {
    plugins: [new MiniCssExtractPlugin()],
  },
  transpileDependencies: true,
  lintOnSave:false,
  //方法一(该方法只能配置单个代理)
  // devServer:{
  //   proxy:'http://localhost:5000'
  // }

  //方法二
  devServer:{
    proxy:{
      '/trent':{
        target:'http://localhost:5000',
        pathRewrite:{'^/trent':''},
        ws:true,//用于支持websocket
        changeOrigin:true
      },
      '/demo':{
        target:'http://localhost:5001',
        pathRewrite:{'^/demo':''},
        ws:true,//用于支持websocket
        changeOrigin:true
      }
    }
  }
})
